package com.example.cqh_votesys.mapper;

import com.example.cqh_votesys.pojo.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {

    /**
     * @param email 用户邮箱
     * @description: 通过email查询这个用户的密码
     * @return:
     * @author: pollux
     * @date: 2024/6/30 14:32
     */
    @Select("select * from user where email = #{email}")
    User getUserByEmail(String email);

    /**
     * @param temp user实体类
     * @description: 修改User的token
     * @return:
     * @author: pollux
     * @date: 2024/6/30 16:13
     */
    @Update("update user set token = #{token} where email = #{email}")
    void update(User temp);
}
